﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using XMK.Framework.Model;
using XMK.Utils;
using XMK.Tadong.DataSearch.Data;

namespace XMK.Tadong.DataSearch.Biz
{
    public class FileSearchBiz
    {
        
        public ResponseInfo SearchFileList(LuceneSort sort, LuceneQuery query, PageInfo pageInfo, string indexPath)
        {
            ResponseInfo response = null;
            try
            {
                FileSearchData data = new FileSearchData(indexPath);
                response = new ResponseInfo();
                response.Data = data.SearchFileList(query, sort, pageInfo);
                response.Page = pageInfo;
            }
            catch (Exception ex)
            {
                //生成返回对象（带错误信息）
                response = new ResponseInfo("error！");
                LogHelper.WriteLog(LogType.Error, "[SearchXmkFileList:]" + ex.ToString());
            }
            return response;
        }
    }
}
